Im

interface Im

Instant messaging module

Types

Link copied to clipboard
object Companion
Link copied to clipboard

Interface defining callbacks for handling events related to Instant Messaging (IM) within the SDK.

Properties

Link copied to clipboard
abstract val allConversations: ArrayItemList<IRainbowConversation>

Get all the conversations of the user in an ArrayItemList.

Link copied to clipboard
abstract val totalUnreadMsgNb: Int

Get the total count of unread messages

Functions

Link copied to clipboard
abstract fun createBookmarkInConversation(conversation: IRainbowConversation, messageId: String, listener: RainbowListener<Unit, Unit>? = null)

Add a bookmark in the conversation on a given message. There can be only one bookmark at a time in a conversation. If a new bookmark is created on a conversation that already has one, the new one replaces the previous one.

Link copied to clipboard
abstract fun createNewConversationFromJid(contactJid: String): IRainbowConversation

Create a new conversation with the given contact jid. The conversation is created at server side asynchronously.

Link copied to clipboard
abstract fun createNewConversationFromRoom(room: Room): IRainbowConversation

Create a new conversation with the given room. The conversation is created at server side asynchronously.

Link copied to clipboard
abstract fun deleteAllMessages(conversation: IRainbowConversation?, listener: RainbowListener<Unit, Unit>?)

Delete all messages from a conversation.

Link copied to clipboard
abstract fun deleteConversation(conversation: IRainbowConversation?, listener: RainbowListener<Unit, Unit>?)

Delete a conversation from the active list of conversations.

Link copied to clipboard
abstract fun deleteConversations(conversations: List<IRainbowConversation>?, listener: RainbowListener<Unit, Unit>?)

Delete a conversation from the active list of conversations.

Link copied to clipboard
abstract fun getConversationFromContact(contactJid: String): IRainbowConversation

Get the conversation from a contact jid. If the conversation does not exist yet, a new one is created.

Link copied to clipboard
abstract fun getConversationFromId(conversationId: String?): IRainbowConversation?

Get a conversation from its id.

Link copied to clipboard
abstract fun getConversationFromJid(conversationJid: String?): IRainbowConversation?

Get a conversation from its jid.

Link copied to clipboard
abstract fun getConversationFromRoom(room: Room): IRainbowConversation

Get the conversation from a room. If the conversation does not exist yet, a new one is created.

Link copied to clipboard
abstract fun getConversationWithContact(contact: IRainbowContact?): IRainbowConversation?

Get the conversation associated to the given contact if any

Link copied to clipboard
abstract fun getMessagesFromConversation(conversation: IRainbowConversation?)

Retrieve the list of the 50 first messages of a given conversation.

abstract fun getMessagesFromConversation(conversation: IRainbowConversation?, nbMessagesToRetrieve: Int)

Retrieve the list of the nbMessagesToRetrieve first messages of a given conversation.

Link copied to clipboard
abstract fun getMessagesFromConversationUntilBookmark(conversation: IRainbowConversation?)

Retrieve the list of the first messages until the bookmark of the conversation plus 10 messages before it.

Link copied to clipboard
abstract fun getMoreMessagesFromConversation(conversation: IRainbowConversation?)

Retrieve the list of the 50 next messages of a given conversation.

abstract fun getMoreMessagesFromConversation(conversation: IRainbowConversation?, nbMessagesToRetrieve: Int)

Retrieve the list of the nbMessagesToRetrieve next messages of a given conversation.

abstract fun getMoreMessagesFromConversationUntilMessageId(conversation: IRainbowConversation?, messageId: String?)

Retrieve the list of next messages of a given conversation until the message with @param messageId is retrieved.

Link copied to clipboard
abstract fun markMessageFromConversationAsRead(conversation: IRainbowConversation?, message: IMMessage?)

Mark a message from a conversation as read.

Link copied to clipboard
abstract fun markMessagesFromConversationAsRead(conversation: IRainbowConversation?): Boolean

Mark all messages from a conversation as read.

Link copied to clipboard
abstract fun muteOrUnmuteConversation(conversationId: String?, mustBeMuted: Boolean, listener: RainbowListener<Unit, Unit>?)

Mute or Unmute notifications for a conversation

Link copied to clipboard
abstract fun refreshConversations(listener: RainbowListener<List<IRainbowConversation>, Unit>?)

Refresh the list of conversations

Link copied to clipboard
abstract fun registerListener(listener: Im.IRainbowImListener?)

Register to the listener with following triggers: onImReceived, onImSent, isTypingState, onMessagesListUpdated, onMoreMessagesListUpdated

Link copied to clipboard
abstract fun removeBookmarkFromConversation(conversation: IRainbowConversation, listener: RainbowListener<Unit, Unit>? = null)

Remove any bookmark from the conversation.

Link copied to clipboard
abstract fun sendConversationByEmail(conversation: IRainbowConversation, email: String, listener: RainbowListener<Unit, Unit>?)

Send all messages from a conversation to the user email.

Link copied to clipboard
abstract fun sendConversationByEmails(conversation: IRainbowConversation, emails: List<String>, listener: RainbowListener<Unit, Unit>?)

Send all messages from a conversation to a list of emails.

Link copied to clipboard
abstract fun sendIsTyping(conversation: IRainbowConversation?, state: ChatState)

Send or not the status isTyping depending on the parameter.

Link copied to clipboard
abstract fun sendMessageToConversation(conversation: IRainbowConversation?, imMessage: IMMessage?)
abstract fun sendMessageToConversation(conversation: IRainbowConversation?, fileDescriptor: RainbowFileDescriptor?, message: String)

Send a message to a given conversation with a file.

abstract fun sendMessageToConversation(conversation: IRainbowConversation?, message: String)

Send a message to a given conversation.

abstract fun sendMessageToConversation(conversation: IRainbowConversation?, message: String?, additionalContents: List<AdditionalContent>)

Send a message to a given conversation with a list of additional contents

abstract fun sendMessageToConversation(conversation: IRainbowConversation?, message: String?, additionalMessageType: String?, additionalMessageContent: String?)

Send a message to a given conversation with a single additional content

Link copied to clipboard
abstract fun sendMessageWithFilesToConversation(conversation: IRainbowConversation?, fileDescriptors: List<RainbowFileDescriptor>?, message: IMMessage)

Send a message to a given conversation with files.

Link copied to clipboard
abstract fun unregisterListener(listener: Im.IRainbowImListener?)

Unregister to the listener with following triggers: onImReceived, onImSent, isTypingState, onMessagesListUpdated, onMoreMessagesListUpdated